//
//  YSSpreadSheetViewConfig.swift
//  YSSpreadSheetView
//
//  Created by 万孟超 on 2023/5/5.
//

import UIKit

public class YSSpreadSheetViewConfig : NSObject {
    
    /// 表格内边距离
    public var contentInsets: UIEdgeInsets = UIEdgeInsets(top: 0, left: 12, bottom: 0, right: 12)
    
    /// 表格背景颜色
    public var sheetBackgroundColor: UIColor = .white
    
    /// 是否显示边框
    public var isShowLine: Bool = true
    
    /// 边框颜色
    public var lineColor: UIColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
    
    /// 边框宽度
    public var lineWidth: CGFloat = 0.5
    
    /// 期望高度
    /// 实现`func spreadSheetView(_ spreadSheetView: YSSpreadSheetView, heightForCellAt section: Int) -> CGFloat`代理后失效
    public var estimatedSectionHeight: CGFloat = 40
    
    /// 高度
    /// `automaticDimension` Cell的高度`>= estimatedSectionHeight`
    public var sectionHeight: CGFloat = automaticDimension
    
    /// 期望宽度
    public var estimatedItemWidth: CGFloat = 0
    
    /// 宽度
    public var itemWidth: CGFloat = automaticDimension
    
    /// 垂直方向多出第一列，如序号
    public var isShowSectionTitle: Bool = false
    
    /// 水平方向多出第一列，如名称
    public var isShowItemTitle: Bool = false
    
    /// 是否均分表格
    /// 为`true`时 `func spreadSheetView(_ spreadSheetView: YSSpreadSheetView, widthForCellAt item: Int) -> CGFloat`代理方法将失效
    /// 为`false`时，取`func spreadSheetView(_ spreadSheetView: YSSpreadSheetView, widthForCellAt item: Int) -> CGFloat`设置的宽度，否则 宽度为`itemWidth`设置的宽度
    public var isAverageSheet: Bool = true
    
    /// 内容是否大于等于容器宽度
    public var boundsToView: Bool = false
    
    /// 每页展示最多列数，> 0
    public var currentShowCount: CGFloat = automaticDimension
    
    public var showsVerticalScrollIndicator: Bool = true

    public var showsHorizontalScrollIndicator: Bool = true
    
    /// View中最多可高亮个数
    public var totalHighLightCountInView: Int = 1
    
    /// 每行可高亮个数
    public var totalHighLightCountInSection: Int = 1
    
    /// 每列中可高亮个数
    public var totalHighLightCountInItem: Int = 1
}

extension YSSpreadSheetViewConfig {
    public static let automaticDimension: CGFloat = -1
}
